<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h3>人的对象:firstname,lastname,age,fullName1()</h3>
		<h3>动态添加：address地址，fullName2()</h3>
		<script type="text/javascript">
			var person ={
				firstname:"张",
				lastname:"迎龙",
				age:"21",
	            fullName1:function(){
					//函数里不能直接访问对象属性，加this关键字
					return this.firstname+this.lastname;
				}
			}
			     console.log(person);
				 console.log(person.firstname);
				 console.log(person.age);
				 console.log(person.fullName1());
				 
				 //动态添加
				 person.address ="广州";
				 person.fullName2=function(){
					 return person.firstname+person.lastname+","+person.age
					 
				 }
				 
				 console.log(person);
			     console.log(person.fullName2())
		</script>
		
		
	</body>
</html>
